package com.lz.football.module.compete.matchResult
{
	import com.common.utils.Reflection;
	import com.liangzhong.model.compete.vo.CompeteMatchResultVo;
	import com.lz.football.module.base.IComponent;
	
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.text.TextField;
	
	public class ResultItem extends Sprite implements IComponent
	{
		/**
		 * 
		 */
		private var _skin:MovieClip;
		
		
		/**
		 *主队 
		 */
		private var homeIcon:MovieClip;
		/**
		 *主队名称  
		 */
		private var homeName:TextField;
		/**
		 *比分 
		 */
		private var score:TextField;
		/**
		 *客队名称  
		 */
		private var gName:TextField;
		/**
		 *客队 
		 */
		private var gIcon:MovieClip;
		public function ResultItem()
		{
			super();
		}
		
		public function initUI(view:Object=null):void
		{
			_skin = Reflection.createInstance("com.football.compete.matchResultItem");
			this.addChild(_skin);
			homeIcon = _skin.homeIcon
			homeName = _skin.homeName;
			score = _skin.score;
			gName = _skin.gName;
			gIcon = _skin.gIcon;
				
		}
		public function setData($obj:Object):void
		{
			if($obj == null)return;
			var vo:CompeteMatchResultVo = $obj.vo;
			homeIcon.gotoAndStop(vo.hId);
			homeName.text = vo.homeName;
			score.text = vo.hgold+ ":" + vo.ggold;
			gName.text = vo.guname;
			gIcon.gotoAndStop(vo.gId);
		}
		
		public function addEvtListener():void
		{
		}
		
		public function removeEvtListener():void
		{
		}
		
		public function destroyView():void
		{
			if(this.parent)this.parent.removeChild(this);
			_skin = null;
		}
	}
}